package com.web;

import com.pojo.Buy_db;
import com.service.BuyService_db;
import com.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/buy")
public class BuyController_db {
    @Autowired
    private BuyService_db buyServiceDb;

    @RequestMapping("/findid")
    public ResultEntity findById(Integer uId,Integer kId){
        return ResultEntity.ok(buyServiceDb.findById(uId, kId));
    }

    @RequestMapping("/add")
    public ResultEntity add(Buy_db buyDb){
        return ResultEntity.ok(buyServiceDb.add(buyDb));
    }
}
